/*
 * 
 * Function.prototype.is is a convenience method for determining if a value
 * is an instance of a certain type. 
 */


    function AbstractType () {;};
    
    ConcreteType.inherit(AbstractType);
    function ConcreteType () {;};
    
    
    Filter.implement
    (
    
        function accept (value) 
        {
            return AbstractType.is(value);
        }
    );
    
    function Filter () {;};
    
    var filter= new Filter;
    alert(filter.accept(0)); // false
    alert(filter.accpet(new AbstractType)); // true
    alert(filter.accpet(new ConcreteType)); // true

    
/*
 * Of note, is that this method elides the distinction between primitive strings
 * booleans and numbers, and object strings, booleans and numbers. That is not
 */

    alert(Number.is(0)); // true
    alert(Number.is(new Number)); // true
    alert(String.is('primitive')); // true
    alert(String.is(new String)); // true
    alert(Boolean.is(false)); // true
    alert(Boolean.is(new Boolean)); // true

/*
 * To determine if a value is primitive, and not an object, you can do this
 */

    function isPrimitive (value) 
    {
       if (null == value)
           return true;
           
       return value === value.constructor(value).valueOf();
    }
